<template>
  <!-- <span :class="res==='正确'?'green':'red'">{{index+1}}.{{res}}</span> -->
  <span :class="whichColor">{{index+1}}.{{res}}</span>
</template>

<script>
export default {
    props:['res','index'],
    data(){
        return {
            // colorStr:'',
        }
    },
    computed:{
        whichColor(){
            if(this.res==='正确'){
                return 'green'
            }else if(this.res==='错误'){
                return 'red'
            }else{
                return 'orange'
            }
        }
    }
}
</script>

<style>
.red {
    color: red;
}
.orange {
    color: orange;
}
.green {
    color:green
}
</style>